#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n, P1, P2, P3, T1, T2;
    cin >> n >> P1 >> P2 >> P3 >> T1 >> T2;

    vector<pair<int, int>> intervals(n);

    for (int i = 0; i < n; ++i) {
        cin >> intervals[i].first >> intervals[i].second;
    }

    long long totalPower = 0;

    for (int i = 0; i < n; ++i) {
        int start = intervals[i].first;
        int end = intervals[i].second;

        // 当前工作时间段耗电
        totalPower += 1LL * (end - start) * P1;

        if (i < n - 1) {
            int nextStart = intervals[i + 1].first;
            int idleTime = nextStart - end;

            // 空闲时间段分为三阶段
            int phase1 = min(idleTime, T1);
            idleTime -= phase1;
            int phase2 = min(idleTime, T2);
            idleTime -= phase2;
            int phase3 = idleTime;

            totalPower += 1LL * phase1 * P1;
            totalPower += 1LL * phase2 * P2;
            totalPower += 1LL * phase3 * P3;
        }
    }

    cout << totalPower << endl;

    return 0;
}